Compares two file versions for equality.
#include <Misc.au3>
_CompareVersion ($sVersion1, $sVersion2)
Parameters
$sVersion1 | The first version |
$sVersion2 | The second version |
Return Value
On Flag = 1 otherwise the script is exitedSuccess: | Returns 0 - Both versions equal |
1 - Version 1 greater | |
-1 - Version 2 greater | |
@extended can be set as follows: 0 - Numeric comparison; 1 - String comparison | |
Failure: | @error will be set in the event of a catasrophic error. |
Remarks
This will try to use a numerical comparison but fall back on a lexicographical comparison.
Related
None.
Example
#include <Misc.au3>
$version1="3.2.3.7"
$version2="3.2.3.10"
If _CompareVersion($version1, $version2) < 0 Then
Msgbox(0,"version1 < version2", $version1 & " " & $version2)
EndIf